<template>
	<view class="details-body">
		<video id="myVideo" autoplay :src="schoolInfo.video_url" :poster="schoolInfo.img" class="details-video"></video>
		<view class="campus-student">
			<view style="width: 100%;">
				<view class="campus-student_name text_black">
					{{schoolInfo.title}}
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default{
		data(){
			return{
				schoolInfo:{},
				videoContext:null,
			}
		},
		onLoad(option) {
			if(option.schoolItem){
				this.schoolInfo = JSON.parse(option.schoolItem)
				console.log(25,this.schoolInfo)
			}
		},
		//页面准备好时创建video
		onReady(res) {
			this.videoContext = uni.createVideoContext('myVideo')
		},
		
		//离开页面时暂停视频播放
		onHide() {
		    this.videoContext.pause();
		},
		methods:{
			
		}
	}
</script>

<style lang="scss" scoped>
	@import url("./index.scss");
	.details-body{
		background-color: #fff;
	}
	.details-video{
		width: 100%;
		height:420rpx;
	}
	.campus-student{
		height: 80rpx;
		width: calc(100% - 60rpx);
		padding: 0 30rpx;
	}
	.campus-student_name{
		margin-top: 20rpx;
	}
	.text_opblack{
		color: $uni-text-color-opblack;
	}
	.text_black{
		color: $uni-text-color-black;
	}
</style>